<!--
 * @Author: Leo.wang wanglizhigs@163.com
 * @Date: 2025-07-08 22:22:18
 * @LastEditors: Leo.wang wanglizhigs@163.com
 * @LastEditTime: 2025-07-09 19:55:21
 * @FilePath: /book-manage-angular/src/app/components/user-info/user-info.component.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- app-user-info.component.html -->

<div class="user-info">

  <a nz-dropdown [nzDropdownMenu]="menu">
    <nz-avatar nzIcon="user" class="avatar-icon mx-4"></nz-avatar>
    <span class="username">{{ userInfo.username }}</span>
    <i nz-icon nzType="down"></i>
  </a>
  <nz-dropdown-menu #menu="nzDropdownMenu">
    <ul nz-menu nzSelectable >
      <li nz-menu-item>用户：{{ userInfo.username }}</li>
      <li nz-menu-item *ngIf="userInfo.role === 'admin'">管理员身份</li>
      <!-- <li nz-menu-item>登录时间：{{ formattedTime }}</li> -->
      <li nz-menu-divider></li>
      <li nz-menu-item nzDanger (click)="onMenuClick()">退出登录</li>
    </ul>
  </nz-dropdown-menu>
</div>